import json
from redis import Redis
from typing import Union,Awaitable


class MyRedis(Redis):
    def hgetll(self,name:str) -> Union[Awaitable[dict],dict]:
        data = super().hgetall(name)
        return {k.decode():json.loads(v.decode()) for k,v in data.items()}

my_cache = Redis()

